﻿using System;
using System.Configuration;

namespace Alex.Library.Log.Configuration
{
    /// <summary>
    /// 日志配置节点
    /// </summary>
    public class NLoggerConfigurationSection : ConfigurationSection
    {
        [ConfigurationProperty("xmlns")]
        public string Namespace
        {
            get
            {
                return (string)this["xmlns"];
            }
        }

        /// <summary>
        /// 文件日志节点集合
        /// </summary>
        [ConfigurationProperty("fileLoggers")]
        public FileLoggerElementCollection FileLoggers
        {
            get
            {
                return (FileLoggerElementCollection)this["fileLoggers"];
            }
        }

        /// <summary>
        /// 控制台日志节点集合
        /// </summary>
        [ConfigurationProperty("consoleLogger")]
        public ConsoleLoggerElement ConsoleLogger
        {
            get
            {
                return (ConsoleLoggerElement)this["consoleLogger"];
            }
        }

        /// <summary>
        /// 代码跟踪日志节点集合
        /// </summary>
        [ConfigurationProperty("traceLogger")]
        public TraceLoggerElement TraceLogger
        {
            get
            {
                return (TraceLoggerElement)this["traceLogger"];
            }
        }

        /// <summary>
        /// XML日志节点集合
        /// </summary>
        [ConfigurationProperty("xmlLoggers")]
        public XmlLoggerElementCollection XmlLoggers
        {
            get
            {
                return (XmlLoggerElementCollection)this["xmlLoggers"];
            }
        }

        /// <summary>
        /// 邮件日志节点集合
        /// </summary>
        [ConfigurationProperty("mailLoggers")]
        public MailLoggerElementCollection MailLoggers
        {
            get
            {
                return (MailLoggerElementCollection)this["mailLoggers"];
            }            
        }

        /// <summary>
        /// 系统日志
        /// </summary>
        //[ConfigurationProperty("eventLogger")]
        //public EventLoggerElement EventLogger
        //{
        //    get
        //    {
        //        return (EventLoggerElement)this["eventLogger"];
        //    }
        //}

        /// <summary>
        /// 自定义日志节点集合
        /// </summary>
        [ConfigurationProperty("customLoggers")]
        public CustomLoggerElementCollection CustomLoggers
        {
            get
            {
                return (CustomLoggerElementCollection)this["customLoggers"];
            }
        }
    }
}
